#include "global_config.h"
#include <qdebug.h>

void global_config::init_log_config(const QString &log_full_path)
{
    qDebug() << "DEAM_UI_LOG_MODULE value:" << DEAM_UI_LOG_MODULE;

    auto logger1 = base_logger::registerLogger(DEAM_UI_LOG_MODULE,
                                          log_full_path.toStdString(),
                                          DEAM_UI_LOG_FILENAME,
                                          spdlog::level::info,
                                          1024*10,
                                          2,
                                          base_logger::Mode::Sync);

    qDebug() << "Created logger name:" << logger1->name().c_str();

    // 现在应该能够通过DEAM_UI_LOG_MODULE获取到logger
    auto re_logger = base_logger::getLogger(DEAM_UI_LOG_MODULE);
    if(!re_logger) {
        qDebug()<<"Still cannot get logger with DEAM_UI_LOG_MODULE";
    } else {
        qDebug()<<"Successfully retrieved logger";
    }
}
